package com.qumitech.visualnovel.datasource.console;

import java.util.*;

import com.qumitech.visualnovel.model.dao.console.BookReadInfoDAOV2;
import com.qumitech.visualnovel.model.dao.console.ChapterInfoDAO;
import com.qumitech.visualnovel.model.dao.console.OptionInfoDAO;
import com.qumitech.visualnovel.model.dto.BookStatisticQueryDTO;
import com.qumitech.visualnovel.model.dao.console.BookReadInfoDAO;
import org.apache.ibatis.annotations.Param;

public interface BookReadInfoDAOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(BookReadInfoDAO record);

    int insertSelective(BookReadInfoDAO record);

    BookReadInfoDAO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(BookReadInfoDAO record);

    int updateByPrimaryKey(BookReadInfoDAO record);

    int total(BookStatisticQueryDTO param);
    List<BookReadInfoDAO> list(BookStatisticQueryDTO param);

    Integer countBookStatisticListV2(@Param("startTime") String startTime,
                                 @Param("endTime") String endTime,
                                 @Param("geoName") String geoName,
                                 @Param("channel") String channel,
                                 @Param("bookTitle") String bookTitle,
                                 @Param("bookIds") List<Integer> bookIds);

    List<BookReadInfoDAOV2> getBookStatisticListV2(@Param("startTime") String startTime,
                                                   @Param("endTime") String endTime,
                                                   @Param("geoName") String geoName,
                                                   @Param("channel") String channel,
                                                   @Param("bookTitle") String bookTitle,
                                                   @Param("bookIds") List<Integer> bookIds,
                                                   @Param("offset") Integer offset,
                                                   @Param("limit") Integer limit);

    Integer countChapterStatisticList(@Param("startTime") String startTime,
                                  @Param("endTime") String endTime,
                                  @Param("geoName") String geoName,
                                  @Param("channel") String channel,
                                  @Param("bookTitle") String bookTitle,
                                  @Param("bookIds") List<Integer> bookIds,
                                  @Param("chapterIndex") Integer chapterIndex);

    List<ChapterInfoDAO> getChapterStatisticList(@Param("startTime") String startTime,
                                                 @Param("endTime") String endTime,
                                                 @Param("geoName") String geoName,
                                                 @Param("channel") String channel,
                                                 @Param("bookTitle") String bookTitle,
                                                 @Param("bookIds") List<Integer> bookIds,
                                                 @Param("chapterIndex") Integer chapterIndex,
                                                 @Param("offset") Integer offset,
                                                 @Param("limit") Integer limit);

    Integer countOptionStatisticList(@Param("startTime") String startTime,
                                 @Param("endTime") String endTime,
                                 @Param("geoName") String geoName,
                                 @Param("channel") String channel,
                                 @Param("bookTitle") String bookTitle,
                                 @Param("bookIds") List<Integer> bookIds,
                                 @Param("chapterIndex") Integer chapterIndex);

    List<OptionInfoDAO> getOptionStatisticList(@Param("startTime") String startTime,
                                               @Param("endTime") String endTime,
                                               @Param("geoName") String geoName,
                                               @Param("channel") String channel,
                                               @Param("bookTitle") String bookTitle,
                                               @Param("bookIds") List<Integer> bookIds,
                                               @Param("chapterIndex") Integer chapterIndex,
                                               @Param("offset") Integer offset,
                                               @Param("limit") Integer limit);
}